cmake_minimum_required(VERSION 3.16)

project(SimpleWorkStation VERSION 0.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt6 REQUIRED COMPONENTS Quick)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)

qt_standard_project_setup(REQUIRES 6.8)

qt_add_executable(SimpleWorkStation
    main.cpp
    qml.qrc
    Images.qrc  # 确保这行存在，将资源文件与可执行文件绑定
)

qt_add_qml_module(SimpleWorkStation
    URI SimpleWorkStation
    VERSION 1.0
    QML_FILES
        Main.qml
        MainNavigationBar.qml
        Top_Window_Step.qml
        AutoProcess.qml
        ManualProcess.qml
        Manual_BasicControl.qml
        Manual_Air_Cylinder.qml
        Manual_Return_Zero.qml
        Manual_Calibration.qml
        CAM_Window.qml
        MaterialEdit.qml
        IO_MonitorWindow.qml
        IO_Monitor_InputSignals.qml
        IO_Monitor_OutputSignals.qml
        ParameterWindow.qml
        Parameter_Manual.qml
        Parameter_Speed.qml
        Parameter_Location.qml
        Parameter_ChangeMode.qml
        Parameter_Time.qml
        Parameter_Knife.qml
        Parameter_Mechine.qml
        Warning_Window.qml
        Warning_Current.qml
        Warning_History.qml
        ConfigWindow.qml

        A_Canvas.qml
        A_Image_Button.qml
        A_Button.qml
        A_SwitchButton.qml
        A_NumberInput.qml
        A_NumberKeyboard.qml
        A_Label.qml
        A_InputField.qml
        A_Input.qml

        SOURCES appengine.h appengine.cpp

)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
set_target_properties(SimpleWorkStation PROPERTIES
#    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.SimpleWorkStation
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

target_link_libraries(SimpleWorkStation
    PRIVATE Qt6::Quick
)
target_link_libraries(SimpleWorkStation PRIVATE Qt6::Core)
target_link_libraries(SimpleWorkStation PRIVATE Qt6::Core)

include(GNUInstallDirs)
install(TARGETS SimpleWorkStation
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
